home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7021 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news.NetVision.net.il!news
  2. From: simchoni@netvision.net.il (Uri Simchoni)
  3. Newsgroups: gnu.gcc.help,comp.os.linux.setup,comp.os.linux.dvelopment.apps,comp.lang.c
  4. Subject: ELF blues - How can I make gcc-2.7.2 automatically find its libraries?
  5. Date: 17 Feb 1996 14:27:22 GMT
  6. Organization: Simchoni Automation Systems Ltd
  7. Message-ID: <4g4oka$ksg@news.NetVision.net.il>
  8. NNTP-Posting-Host: ts4hp16.netvision.net.il
  9. Mime-Version: 1.0
  10. X-Newsreader: WinVN 0.99.3
  11.  
  12. Hi,
  13.  
  14. Iv'e been using Slackware 2.3 linux for six months now (kernel 1.2.8 
  15. and then 1.3.32) when I decided to upgrade my C compiler - mainly because 
  16. 2.6.3 is reported to produce buggy kernels.
  17.  
  18. I downloaded the latrest gcc, libc, libg++, binutils manual pages and 
  19. ld.so from a tsx-11 mirror, and successfully installed them on my system 
  20. (in the sense that all the a.out stuff is still working and all the new 
  21. stuff is untarred into its default place)
  22.  
  23. When I try to do - 
  24.  
  25. gcc hello.c
  26.  
  27. the linker can't find libc.a. What works is:
  28.  
  29. gcc hello.c -L/usr/lib -lc
  30. or
  31. gcc hello.c /usr/lib/libc.a
  32.  
  33. In addition, when I compile using shared libraries:
  34.  
  35. gcc -shared hello.c 
  36.  
  37. the compilation and linkage goes well, but I get a segmentation fault 
  38. when I run the program.
  39.  
  40. This all seems like a matter of library location. I would like to somehow 
  41. tell gcc to look for libc.a in /usr/lib, or move libc.a elsewhere so it 
  42. can find it. I'm also concerned with the shared library problem - here 
  43. I'm really in the dark.
  44.  
  45. Can anyone help me with this?
  46.  
  47. Thanks,
  48. Uri.
  49.  
  50.